﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using VAdvantage.Install;
//using VAdvantage.WindowMigration;

namespace VAdvantage.DataBase
{
    /// <summary>
    /// Gets the Currently configured database with the current application
    /// </summary>
    public static class DatabaseType
    {
        #region Used Database Properties
        /// <summary>
        /// To check if Used Databae is MySQL
        /// </summary>
        public static bool IsMySql
        {
            get
            {
                if (!DataBase.DB.UseMigratedConnection)
                {
                    if (VConnection.Get().IsMysql())
                        return true;
                    return false;

                }
                else
                {
                    if (false)
                    {
                        return true;
                    }
                    return false;
                }
            }
        }

        /// <summary>
        /// To check if Used Databae is MSSQL
        /// </summary>
        public static bool IsMSSql
        {
            get
            {
                if (!DataBase.DB.UseMigratedConnection)
                {
                    if (VConnection.Get().IsMSSQLServer())
                        return true;
                    return false;
                }
                else
                {
                    if (false)//  MDialog.GetMConnection().IsMSSQLServer())
                    {
                        return true;
                    }
                    return false;
                }
            }
        }

        /// <summary>
        /// To check if Used Databae is Postgre SQL
        /// </summary>
        public static bool IsPostgre
        {
            get
            {
                if (!DataBase.DB.UseMigratedConnection)
                {
                    if (VConnection.Get().IsPostgreSQL())
                        return true;
                    return false;

                }
                else
                {
                    if (false)//  MDialog.GetMConnection().IsPostgreSQL())
                    {
                        return true;
                    }
                    return false;
                }
            }
        }

        /// <summary>
        /// To check if Used Databae is Oracle
        /// </summary>
        public static bool IsOracle
        {
            get
            {
                if (!DataBase.DB.UseMigratedConnection)
                {
                    if (VConnection.Get().IsOracle())
                        return true;
                    return false;

                }
                else
                {
                    if (false) //MDialog.GetMConnection().IsOracle())
                    {
                        return true;
                    }
                    return false;
                }
            }
        }



        #endregion
    }
}
